import {useLocation} from 'react-router-dom';
import {useEffect,useState} from 'react';
function usePathkey(){
    // 获取路由信息
    let location = useLocation();
    let [pathname,setPathName] = useState<string>("");
    useEffect(()=>{
        setPathName(location.pathname.split("/")[2])
    },[location])   
    return pathname; 
}

export default usePathkey;